<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Hammerspoon docs: ToggleScreenRotation</title>
    <style type="text/css">
      a { text-decoration: none; }
      a:hover { text-decoration: underline; }
      th { background-color: #DDDDDD; vertical-align: top; padding: 3px; }
      td { width: 100%; background-color: #EEEEEE; vertical-align: top; padding: 3px; }
      table { width: 100% ; border: 1px solid #0; text-align: left; }
      section > table table td { width: 0; }
    </style>
    <link rel="stylesheet" href="docs.css" type="text/css" media="screen" />
  </head>
  <body>
    <header>
      <h1><a href="./index.html">docs</a> &raquo; ToggleScreenRotation</h1>
      <p>Toggle rotation on external screens</p>
<p>Download: <a href="https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ToggleScreenRotation.spoon.zip">https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ToggleScreenRotation.spoon.zip</a></p>
<p>Makes the following simplifying assumptions:</p>
<ul>
<li>That you only toggle between two positions for rotated/not
rotated (configured in <code>rotating_angles</code>, and which apply to all
screens)</li>
<li>That "rotated" means "taller than wider", for the purposes of
determining if the screen is rotated upon initialization.</li>
</ul>

      </header>
      <h3>API Overview</h3>
      <ul>
        <li>Variables - Configurable values</li>
          <ul>
            <li><a href="#rotating_angles">rotating_angles</a></li>
            <li><a href="#screens_to_skip">screens_to_skip</a></li>
          </ul>
        <li>Methods - API calls which can only be made on an object returned by a constructor</li>
          <ul>
            <li><a href="#bindHotkeys">bindHotkeys</a></li>
          </ul>
      </ul>
      <h3>API Documentation</h3>
        <h4 class="documentation-section">Variables</h4>
          <section id="rotating_angles">
            <a name="//apple_ref/cpp/Variable/rotating_angles" class="dashAnchor"></a>
            <h5><a href="#rotating_angles">rotating_angles</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>ToggleScreenRotation.rotating_angles</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Two-element table containing the rotation angles for "normal" and "rotated". Defaults to <code>{ 0, 90 }</code> and should only be changed if you really know what you are doing.</p>
</td>
              </tr>
            </table>
          </section>
          <section id="screens_to_skip">
            <a name="//apple_ref/cpp/Variable/screens_to_skip" class="dashAnchor"></a>
            <h5><a href="#screens_to_skip">screens_to_skip</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>ToggleScreenRotation.screens_to_skip</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Lua patterns for screens that shouldn't be rotated, even if they match one of the patterns.
Defaults to <code>{ "Color LCD", "iMac" }</code>, which excludes the built-in display on laptops and iMacs.</p>
</td>
              </tr>
            </table>
          </section>
        <h4 class="documentation-section">Methods</h4>
          <section id="bindHotkeys">
            <a name="//apple_ref/cpp/Method/bindHotkeys" class="dashAnchor"></a>
            <h5><a href="#bindHotkeys">bindHotkeys</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>ToggleScreenRotation:bindHotkeys(mapping)</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Method</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Binds hotkeys for ToggleScreenRotation.</p>
<p>Parameters:</p>
<ul>
<li>mapping - A table containing hotkey modifier/key details to rotate screens. Instead of fixed "key names", each key must be the name of a screen to rotate, or a Lua pattern - in this case the first screen to match the pattern will be rotated. The value is a table containing the hotkey modifier/key details as usual. You can use the special key <code>first</code> (or the Lua pattern <code>[".*"]</code>) to match the first external screen, which should be sufficient unless you have more than one external screen. Example (bind Ctrl-Cmd-Alt-F15 to rotate the first external screen):
<pre><code>  [".*"] = { {"ctrl", "cmd", "alt"}, "f15" }</code></pre>
</li>
</ul>
</td>
              </tr>
            </table>
          </section>
  </body>
</html>